var resRef={
    player:'player',
    vertical_wall:'wallV',
    horizontal_wall:'wallH',
    coin:'coin',
    enemy:'enemy',
    background:'background',
    jumpEf:'jump',
    cointEf:'coin',
    deadEf:'dead',
    music:'music',
    pixel:'pixel',
    mute:'mute',
    tileset:'tileset',
    map:'map',
    jumpButton:'jumpButton',
    rightButton:'rightButton',
    leftButton:'leftButton',
    ef0:'ef0',
    ef1:'ef1',
    ef2:'ef2',
    ef3:'ef3',
    ef4:'ef4',
    ef5:'ef5',
    ef6:'ef6'
};
var loadState={
    preload:function(){
        var loadingLabel=game.add.text(game.world.centerX,150,'loading...',
            {font:'30px Arial',fill:'#fff'});
        loadingLabel.anchor.setTo(0.5);
        var progressBar=game.add.sprite(game.world.centerX,200,'progressBar');
        progressBar.anchor.setTo(0.5);
        game.load.setPreloadSprite(progressBar);
        game.load.spritesheet(resRef.player,'res/player2.png',20,20);
        game.load.image(resRef.enemy,'res/enemy.png');
        game.load.image(resRef.coin,'res/coin.png');
        game.load.image(resRef.background,'res/background.png');
        //game.load.image(resRef.vertical_wall,'res/wallVertical.png');
        //game.load.image(resRef.horizontal_wall,'res/wallHorizontal.png');
        game.load.audio(resRef.jumpEf,['res/jump.ogg','assets/jump.mp3']);
        game.load.audio(resRef.cointEf,['res/coin.ogg','res/coin.mp3']);
        game.load.audio(resRef.deadEf,['res/dead.ogg','res/dead.mp3']);
        game.load.audio(resRef.music,['res/music.mp3']);
        game.load.image(resRef.pixel,'res/pixel.png');
        game.load.spritesheet(resRef.mute,'res/muteButton.png',28,22);
        game.load.image(resRef.tileset,'res/tileset.png');
        game.load.tilemap(resRef.map,'res/map.json',null,Phaser.Tilemap.TILED_JSON);
        game.load.image(resRef.jumpButton,'res/jumpButton.png');
        game.load.image(resRef.rightButton,'res/rightButton.png');
        game.load.image(resRef.leftButton,'res/leftButton.png');
        //add ef
        game.load.audio(resRef.ef0,['res/ef/0.mp3','res/ef/0.ogg']);
        game.load.audio(resRef.ef1,['res/ef/1.mp3','res/ef/1.ogg']);
        game.load.audio(resRef.ef2,['res/ef/2.mp3'],'res/ef/2.ogg');
        game.load.audio(resRef.ef3,['res/ef/3.mp3'],'res/ef/3.ogg');
        game.load.audio(resRef.ef4,['res/ef/4.mp3'],'res/ef/4.ogg');
        game.load.audio(resRef.ef5,['res/ef/5.mp3'],'res/ef/5.ogg');
        game.load.audio(resRef.ef6,['res/ef/6.mp3'],'res/ef/6.ogg');

    },
    create:function(){
        game.state.start('menu');
    }
}